package com.example.mapper;

import com.example.annotation.PublicAutoFill;
import com.example.enumeration.OperationType;
import com.github.pagehelper.Page;
import com.pojo.dto.CategoryDTO;
import com.pojo.dto.QueryPageDTO;
import com.pojo.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {

    Page<Category> queryPage(QueryPageDTO queryPageDTO);

    @PublicAutoFill(OperationType.INSERT)
    void save(Category category);

    void deleteById(Long id);

    @PublicAutoFill(OperationType.UPDATE)
    void update(Category category);

    Category getById(Long id);

    @Select("select * from category")
    List<Category> allList();
}
